compare two linked lists hackerrank